#include "bomb.h"
#include "config.h"

Bomb::Bomb()
{
    //导入数组
    for(int i=1;i<=EXP_MAX;i++){
        QString str=QString(BOMB_PATH).arg(i);
        m_pixArr.push_back(QPixmap(str));
    }

    //坐标
    m_X=0;
    m_Y=0;

    //空闲状态
    m_Free=true;

    //当前动画状态
    m_index=0;

    //间隔记录
    m_Recorder=0;
}

void Bomb::updateInfo()
{
    if(m_Free){
        return;
    }

    m_Recorder++;
    if(m_Recorder<EXP_SPACE){
        return;
    }

    m_Recorder=0;
    m_index++;
    if(m_index>=EXP_MAX){
        m_index=0;
        m_Free=true;
    }
}
